]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Use microseconds for notify_keyval()
authorSebastian Keller <skeller@gnome.org>
Thu, 22 Jul 2021 15:24:30 +0000 (17:24 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 29 Jul 2021 20:18:51 +0000 (20:18 +0000)
ClutterVirtualInputDevice::notify_keyval() expects time to be in
microseconds but Clutter::get_current_event_time() returns the time in
milliseconds. On Wayland the generated event triggers all the warnings
in MetaDisplay::sanity_check_timestamps() due to the event time
seemingly being in the past.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1926>

js/ui/keyboard.js

index bc72d77f3d36e2a756291493a4410e7cc914034c..d0dde5b23aa5f22672dbfc4fcdeed646d27ba763 100644 (file)
@@ -2125,12 +2125,12 @@ var KeyboardController = class {
     }
 
     keyvalPress(keyval) {
-        this._virtualDevice.notify_keyval(Clutter.get_current_event_time(),
+        this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000,
                                           keyval, Clutter.KeyState.PRESSED);
     }
 
     keyvalRelease(keyval) {
-        this._virtualDevice.notify_keyval(Clutter.get_current_event_time(),
+        this._virtualDevice.notify_keyval(Clutter.get_current_event_time() * 1000,
                                           keyval, Clutter.KeyState.RELEASED);
     }
 };